﻿using System;
using System.Collections.Generic;
using System.Web;
using PayRoller.Code;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using HySoft.Cash.Business;
using HySoft.Cash.Structure;
using System.Configuration;
using System.Web.Profile;
using System.Web.UI;

namespace PayRoller.Manage.OrgInfo
{
    public class MemMaster : MasterPage
    {
        // Fields
        protected ContentPlaceHolder ContentPlaceHolder1;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        public string OrgSid = "";
        protected ScriptManager ScriptManager1;
        protected TreeView TreeView1;

        // Methods
        public void GetLeftTree(string psOrgSid)
        {
            TreeNode child = new TreeNode("MySite", "");
            TreeNode node2 = new TreeNode();
            TreeNode node3 = new TreeNode();
            child.Expanded = true;
            child.ImageUrl = "~/Images/icon/base.gif";
            child.NavigateUrl = "Index.aspx?OrgSid=" + psOrgSid;
            node2 = new TreeNode("My Profile", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "javascript:void('')";
            node3 = new TreeNode("View my details", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "MyProfile.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            node3 = new TreeNode("Update my details", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "MyProfileUpt.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            node3 = new TreeNode("Change my password", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "ChangePwd.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Tax Invoices", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "javascript:void('')";
            node3 = new TreeNode("Send Invoices", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "InvoiceSend.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            node3 = new TreeNode("Invoices List", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "InvoicesList.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Employee Details", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "javascript:void('')";
            node3 = new TreeNode("Employee search", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "EmpList.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            node3 = new TreeNode("Update History Report", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "EmpUptHistory.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Add Employee", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "EmpAdd.aspx?OrgSid=" + psOrgSid;
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Import Payments", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "ImpPay.aspx?OrgSid=" + psOrgSid;
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Credit Limit", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "CreditLimit.aspx?OrgSid=" + psOrgSid;
            child.ChildNodes.Add(node2);
            node2 = new TreeNode("Receiving payments", "");
            node2.Expanded = true;
            node2.ImageUrl = "~/Images/icon/folder.gif";
            node2.NavigateUrl = "javascript:void('')";
            node3 = new TreeNode("New Receiving", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "ReceivingNew.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            node3 = new TreeNode("Receiving List", "");
            node3.ImageUrl = "~/Images/icon/file.gif";
            node3.NavigateUrl = "ReceivingList.aspx?OrgSid=" + psOrgSid;
            node2.ChildNodes.Add(node3);
            child.ChildNodes.Add(node2);
            this.TreeView1.Nodes.Add(child);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.Request["OrgSid"] != null)
            {
                this.OrgSid = base.Request["OrgSid"].ToString();
                if (!this.Page.IsPostBack)
                {
                    this.GetLeftTree(this.OrgSid);
                }
            }
        }

        // Properties
        protected HttpApplication ApplicationInstance
        {
            get
            {
                return this.Context.ApplicationInstance;
            }
        }

        protected DefaultProfile Profile
        {
            get
            {
                return (DefaultProfile)this.Context.Profile;
            }
        }
    }

}
